import{Route} from "react-router-dom"
import{isAuth,}from "../../utils"
{/* <Route path="/login" component={Login}></Route> */}
const AuthRoute=({component:Comp,...rest})=>{
    // const Comp=component
    return (<Route
    {...rest}
    render={props=>{

        const isLogin=isAuth()
        if (isLogin) {
            return <Comp {...props}/>
        }
        props.history.push("/login",{
            from:props.location.pathname
        })
    }}
    />
    )
}
export {AuthRoute}